package com.sunsy.authserver.exception;

import com.sunsy.authserver.enums.IApiErrorCode;

/**
 * @author 孙思远
 * @date 2021/7/19
 */
public class ValidateException extends RuntimeException {

  private static final long serialVersionUID = 1122286121727466387L;
  private IApiErrorCode errorCode;

  public ValidateException(IApiErrorCode errorCode) {
    super(errorCode.getMsg());
    this.errorCode = errorCode;
  }

  public ValidateException(String message) {
    super(message);
  }

  public ValidateException(String message, Throwable cause) {
    super(message, cause);
  }

  public ValidateException(Throwable cause) {
    super(cause);
  }

  public IApiErrorCode getErrorCode() {
    return errorCode;
  }
}
